home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / pc100.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  3KB  |  96 lines

  1. /* UNFINISHED! */
  2. /* Hardware-dependent routines for the PACCOMM PC-100 card for the PC
  3.  * This card contains a Zilog 8530 plus two modems, one of which is an
  4.  * AMD 7910, and one of which is a TCM3105.
  5.  *
  6.  * Originally written by Phil Karn KA9Q for an early rev of the board which
  7.  * did interrupt acks wrong.  Hacked by Bdale Garbee N3EUA to work with beta
  8.  * copies of the second major revision of the card.
  9.  */
  10. #define    NPC    1        /* One card max */
  11. #define    AX_MTU    512
  12. #define    INTMASK    0x21        /* Intel 8259 interrupt controller mask */
  13.  
  14. struct pc100 {
  15.     void (*oldvec)();/* Original interrupt vector contents */
  16.     int16 addr;    /* Base I/O address */
  17.     unsigned vec;    /* Vector */
  18.     long ints;    /* Interrupt count */
  19. };
  20. extern struct pc100 pc100[];
  21.  
  22. /* Register offset info, specific to the PC-100
  23.  * E.g., to read the data port on channel A, use
  24.  *      inportb(hdlc[dev].base + CHANA + DATA)
  25.  */
  26. #define    MODEM_CTL    0    /* modem control port, write only */
  27. /* #define    CHANB        4    /* Base of channel B regs */
  28. /* #define    CHANA        6    /* Base of channel A regs */
  29. #define    CHANB        6    /* Base of channel B regs */
  30. #define    CHANA        4    /* Base of channel A regs */
  31. #define INTACK        8    /* access this to wang 8530's INTA.L */
  32.  
  33. /* 8530 ports on each channel */
  34. /* #define    CTL    0 */
  35. /* #define    DATA    1 */
  36. #define    CTL    1
  37. #define    DATA    0
  38.  
  39. struct hdlc {
  40.     long rxints;        /* Receiver interrupts */
  41.     long txints;        /* Transmitter interrupts */
  42.     long exints;        /* External/status interrupts */
  43.     long spints;        /* Special receiver interrupts */
  44.  
  45.     int nomem;        /* Buffer allocate failures */
  46.     int toobig;        /* Giant receiver packets */
  47.     int crcerr;        /* CRC Errors */
  48.     int aborts;        /* Receiver aborts */
  49.  
  50.     char status;        /* Copy of R0 at last external interrupt */
  51.     struct mbuf *rcvq;    /* Receive queue */
  52.     int16 rcvcnt;        /* Number of packets on rcvq */
  53.     struct mbuf *rcvbuf;    /* Buffer for current rx packet */
  54.     int16 bufsiz;        /* Size of rcvbuf */
  55.     char *rcp;        /* Pointer into rcvbuf */
  56.  
  57.     struct mbuf *sndq;    /* Packets awaiting transmission */
  58.     int16 sndcnt;        /* Number of packets on sndq */
  59.     struct mbuf *sndbuf;    /* Current buffer being transmitted */
  60.     int tstate;        /* Tranmsitter state */
  61. #define    IDLE    0        /* Transmitter off, no data pending */
  62. #define    DEFER    1        /* Transmitter off, waiting for channel clear*/
  63. #define    KEYUP    2        /* Transmitter on, waiting for CTS */
  64. #define    ACTIVE    3        /* Transmitter on, sending data */
  65. #define    FLUSH    4        /* Transmitter on, flushing tx buffers */
  66. #define    FIN2    5        /* Ditto, second char */
  67.  
  68.     int mode;        /* Transmitter mode */
  69. #define    CSMA    0        /* Carrier-sense multiple access */
  70. #define    FULLDUP    1        /* Full duplex */
  71.  
  72.     int16 dev;        /* Device number */
  73.     int16 base;        /* Base of I/O registers */
  74.     int16 speed;        /* Line speed, bps */
  75. };
  76. extern struct hdlc hdlc[];
  77.  
  78. /* Interrupt vector handlers (assembler) */
  79. void pcint();
  80.  
  81. /* Other utility routines */
  82. char read_sio();
  83.  
  84. #define    OFF    0
  85. #define    ON    1
  86.  
  87. /* 8530 clock speed */
  88. /* #define    XTAL    ((unsigned)38400)    /* 2.4576 Mhz / (2*32) */
  89. #define    XTAL    ((unsigned)76797)    /* 4.915 Mhz / (2*32) */
  90.  
  91. /* Baud rate generator definitions */
  92. struct baudrate {
  93.     int16 speed;
  94.     char val;
  95. };
  96.